home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Scheduling / Cassandra / Source / ClockPS.psw < prev    next >
Encoding:
Text File  |  1990-06-10  |  705 b   |  34 lines

  1. /* drawClockHand draws a line with the specified width and color. 
  2. ** The line starts at 0, 0 and spans the specified length in the 
  3. ** direction specified by angle. Despite its name, this function is
  4. ** a pretty generic line drawer.
  5. */
  6. defineps drawClockHand (float angle; float length; float gray; float width)
  7.     gsave
  8.     angle rotate
  9.     0 0 moveto 0 length lineto 
  10.     width setlinewidth
  11.     gray setgray
  12.     stroke
  13.     grestore
  14. endps
  15.  
  16. /* Center string at x, y at pointsize size
  17.  */
  18. defineps drawClockString (int x; int y; int size; char *string)
  19.     0.0 setgray
  20.     x y moveto
  21.     /Times-Roman findfont size scalefont setfont
  22.     (string)
  23.     dup
  24.     stringwidth
  25.     pop
  26.     2 div
  27.     currentpoint
  28.     3 -2 roll
  29.     exch sub exch
  30.     moveto
  31. show
  32. endps
  33.  
  34.